<template>
  <div class="house" @click="housemesg">
    <!-- 找房信息展示 -->
    <van-card
      :price="list.price"
      :desc="list.desc"
      :title="list.title"
      :thumb="url + list.houseImg"
    >
      <template #tags>
        <van-tag
          plain
          type="danger"
          v-for="(item, index) in list.tags"
          :key="index"
          >{{ item }}</van-tag
        >
      </template>
    </van-card>
  </div>
</template>

<script>
// 引入接口
export default {
  props: {
    list: {
      type: Object,
      default: () => {}
    }
  },
  data () {
    return {
      url: 'http://liufusong.top:8080'
    }
  },
  methods: {
    // 点击房源信息
    housemesg () {
      this.$router.push({
        path: `/details?id=${this.list.houseCode}`
      })
      console.log(this.list.houseCode)
      console.log(this.list)
    }
  }
}
</script>

<style>
.house {
  margin: 0 10px;
  border-bottom: rgb(223, 210, 210) solid 1px;
}
.van-tag--danger.van-tag--plain {
  color: #6ecad4;
  background-color: #e1f5f8;
}
.van-card__price {
  font-size: 10px;
  color: #fa5741;
}
#app {
  text-align: left;
}
.delete-button {
  height: 100%;
}
</style>
